//
//  ScrollWebViewController.m
//  Tour
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "ScrollWebViewController.h"
#import "AdvanceEdit.h"
@interface ScrollWebViewController ()<UIWebViewDelegate>

@property (nonatomic, retain)MBProgressHUD *HUD;
@end

@implementation ScrollWebViewController
{
    UIActivityIndicatorView *acView;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    UIWebView *wv = [[UIWebView alloc] initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height)];
    [self.view addSubview:wv];
    wv.delegate = self;
    wv.scalesPageToFit = YES;
    
    acView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 32.0f, 32.0f)];
    acView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
    acView.center = self.view.center;
    [self.view addSubview:acView];
    NSURL *url = [NSURL URLWithString:self.urlStr];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [wv loadRequest:request];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(0, 10, 50, 40);
    button.tintColor = [UIColor blackColor];
    [button setTitle:@"返回" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];

}
- (void)click:(UIButton *)button{
    [self dismissViewControllerAnimated:YES completion:^{
        
        
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
